@echo off
echo 下载项目依赖...

REM 创建lib目录（如果不存在）
if not exist lib mkdir lib
cd lib

echo 下载Protobuf...
powershell -Command "Invoke-WebRequest -Uri 'https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.24.3/protobuf-java-3.24.3.jar' -OutFile 'protobuf-java-3.24.3.jar'"

echo 下载WebSocket API...
powershell -Command "Invoke-WebRequest -Uri 'https://repo1.maven.org/maven2/javax/websocket/javax.websocket-api/1.1/javax.websocket-api-1.1.jar' -OutFile 'javax.websocket-api-1.1.jar'"

echo 下载Tyrus WebSocket实现...
powershell -Command "Invoke-WebRequest -Uri 'https://repo1.maven.org/maven2/org/glassfish/tyrus/tyrus-server/2.1.3/tyrus-server-2.1.3.jar' -OutFile 'tyrus-server-2.1.3.jar'"
powershell -Command "Invoke-WebRequest -Uri 'https://repo1.maven.org/maven2/org/glassfish/tyrus/tyrus-container-grizzly-server/2.1.3/tyrus-container-grizzly-server-2.1.3.jar' -OutFile 'tyrus-container-grizzly-server-2.1.3.jar'"

echo 下载日志相关依赖...
powershell -Command "Invoke-WebRequest -Uri 'https://repo1.maven.org/maven2/ch/qos/logback/logback-classic/1.4.14/logback-classic-1.4.14.jar' -OutFile 'logback-classic-1.4.14.jar'"
powershell -Command "Invoke-WebRequest -Uri 'https://repo1.maven.org/maven2/org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9.jar' -OutFile 'slf4j-api-2.0.9.jar'"

echo 下载工具类依赖...
powershell -Command "Invoke-WebRequest -Uri 'https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar' -OutFile 'commons-lang3-3.12.0.jar'"
powershell -Command "Invoke-WebRequest -Uri 'https://repo1.maven.org/maven2/com/google/guava/guava/32.1.2-jre/guava-32.1.2-jre.jar' -OutFile 'guava-32.1.2-jre.jar'"

cd ..

echo 依赖下载完成！
echo 现在您可以使用 manually_build.bat 脚本手动构建项目。
pause 